{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 逻辑回归中使用多项式特征"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> 核心是把高次幂的项看做一个整体，画图的时候再替换下就好了\n",
    "\n",
    "![多项式如何等效成线性方程](images/多项式如何等效成线性方程.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 演示一个圆形边界"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.random.seed(666)\n",
    "X = np.random.normal(0, 1, size=(200, 2)) # 生成均值为0，方差为1的200行2列的数据\n",
    "y = np.array(X[:, 0]**2 + X[:, 1]**2 < 1.5, dtype='int') # 两个特征的平方和小于1.5时为True(可以看做0)，大于等于1.5时看做1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3df4xd5Xkn8O8z12O4kNaDhbWJx3aMupbTBNx4O2WzImoTYG1oEuK4W2/Tqo2aKhZSf4T+8NqUFRhWVey1lLRbrbR1CtpmN7RMF2MIBJkkpMqCloQxNkMc4w0tovY42pjCuCG+icfjZ/84c8Z37pz3nPc95z0/3nu/HwnhuXPvue8de57znud93ueIqoKIiMI1VPcAiIioGAZyIqLAMZATEQWOgZyIKHAM5EREgVtSx5teffXVunbt2jremogoWIcPH35dVVf0Pl5LIF+7di0mJib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fVMpZ+DuRERIOgr1MrRESDgIGciChwDORERIFjICciChwDORFR4BjIiYgCx0BORBS4/w/a3cbqZtleCwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[y==0, 0], X[y==0, 1])\n",
    "plt.scatter(X[y==1, 0], X[y==1, 1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from playML.LogisticRegression import LogisticRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegression()"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "log_reg = LogisticRegression()\n",
    "log_reg.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.605"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "log_reg.score(X, y) # 预测正确率不高"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plot_decision_boundary(model, axis):\n",
    "    \"\"\"\n",
    "    根据模型绘制决策边界\n",
    "    \"\"\"\n",
    "    x0, x1 = np.meshgrid(\n",
    "        np.linspace(axis[0], axis[1], int((axis[1]-axis[0])*100)).reshape(-1, 1),\n",
    "        np.linspace(axis[2], axis[3], int((axis[3]-axis[2])*100)).reshape(-1, 1),\n",
    "    )\n",
    "    X_new = np.c_[x0.ravel(), x1.ravel()]\n",
    "\n",
    "    y_predict = model.predict(X_new)\n",
    "    zz = y_predict.reshape(x0.shape)\n",
    "\n",
    "    from matplotlib.colors import ListedColormap\n",
    "    custom_cmap = ListedColormap(['#EF9A9A','#FFF59D','#90CAF9'])\n",
    "    \n",
    "    plt.contourf(x0, x1, zz, linewidth=5, cmap=custom_cmap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:17: UserWarning: The following kwargs were not used by contour: 'linewidth'\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO2dfZAc5X3nv7/dHbEDXoMWidOyi05yYekkhJE4jji34YyxhIVwoBLLPnI48ZFQOr/w4tgpHKwqkpAofqvCNvglp0BsX8UXjEUcU0YBSwXYWHW2wSCBVkIqDGatZSkkC8wYdqWd3d/9Mdureemn++nuZ6Z7er6fKqqY2Z6nf6vd/T6//r09oqoghBCSH7rSNoAQQohbKOyEEJIzKOyEEJIzKOyEEJIzKOyEEJIzKOyEEJIznAm7iHSLyJMi8n1XaxJCCImOS4/9RgD7Ha5HCCEkBk6EXUSGAFwO4E4X6xFCCIlPj6N1vgjgJgB9pgtEZBOATQBwykkn/ee3Llrk6NaEVOjuB16eOD1tMwhpGr965okjqrow7LrEwi4i7wHwsqr+XEQuNl2nqlsBbAWANUuW6MObNye9NSE1fHP1B9M2gZCm8rELT3rB5joXoZhhAFeIyC8B3A3gEhH5ZwfrEmLNaVd3p20CIZkhsbCr6s2qOqSqSwBcBeAhVf1AYssIicCXRvgrR4gH69hJ20NvnZBaXCVPAQCq+giAR1yuSUgY9NYJqYUeO2lrmDAlpBEKOyGE5AwKO2lb6K0T4g+FnbQlTJgSYobCTtoSJkwJMUNh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bAWwWkZsBXAfgr1pqIMJtnL1mMyqPwN9qpW3V2NiZUcTnvcx5bu2GiLwJwL0APlb39JsZVHUawOrZ3NR3RWSVqmYmhyEi7wHwsqr+XEQutvlMU4W9XcYRmOz04f8CuB8pCHuYjSLyQQDvQWUoW2qCFOHfMmscAnBW1eshAC+mZEsuEJECKqL+LVX917TtCUNVXxWRR1DJYWRG2AEMA7hCRDYA6AXwZhH5Z1U1HjSRSihGVZ9W1TNUdYmqLkHlj+r8LM6YEZG3Vr28AsAzadliQkTWA/gkgCtU9Y207WlTHgPwVhFZKiLzAFwF4L6UbWpbpOKx3QVgv6relrY9JkRkoVdFJiJFAGuRsb9xVb1ZVYdmtfIqAA8FiTqQfvK0HfiMiOwVkadQCR1lsWzrywD6AOyYLcv8h7QN8kNE/kBEDgH4XQD3i8iDadvkMZt8vg7Ag6gk+u5R1ZF0rWpERP4FwP8DsFxEDonIn6Vtk4FhAH8M4JLZ38ndsx5n1hgA8PDs3/djqMTYQ8sJsw5HChBCSM6gx04IITmDwk4IITmDwk4IITmDwk4IITmDwk4IITmDwk4IITmDwk4IITnj/wOmcHutlNowcQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(log_reg, axis=[-4, 4, -4, 4])\n",
    "plt.scatter(X[y==0, 0], X[y==0, 1])\n",
    "plt.scatter(X[y==1, 0], X[y==1, 1])\n",
    "plt.show() # 从下图可以看到直接使用直线，预测效果比较差"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 为逻辑回归添加多项式项"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 为逻辑回归添加多项式项的管道\n",
    "from sklearn.pipeline import Pipeline\n",
    "from sklearn.preprocessing import PolynomialFeatures\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "def PolynomialLogisticRegression(degree):\n",
    "    return Pipeline([\n",
    "        ('poly', PolynomialFeatures(degree)), # 把高次幂转换为线性方程\n",
    "        ('std_scaler', StandardScaler()),\n",
    "        ('log_reg', LogisticRegression()) # 我们自己实现地逻辑回归类是遵循scikit-learn标准的，所以可以无缝地传给Pipeline\n",
    "    ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "         steps=[('poly',\n",
       "                 PolynomialFeatures(degree=2, include_bias=True,\n",
       "                                    interaction_only=False, order='C')),\n",
       "                ('std_scaler',\n",
       "                 StandardScaler(copy=True, with_mean=True, with_std=True)),\n",
       "                ('log_reg', LogisticRegression())],\n",
       "         verbose=False)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg = PolynomialLogisticRegression(degree=2)# degree 越大，曲线越规则\n",
    "poly_log_reg.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:17: UserWarning: The following kwargs were not used by contour: 'linewidth'\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3dfZRU9Zkn8O9TL9iFlkArLG23ionBVTCC67qZxVmNwQRJomdmSI6zOsM6k8PJi8icZNbE9B4y4ywzJjnHNSEvs6yZhD06YwyOiYn4AkdJlDN5MdIoLYHDOIHQaRYNAoVUS1fXs39U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ERE/kBEDgL4PQBPiMjTnR6TZXLx+Q4AT6Oy0PeIqg53dlSNROSfAPwLgEtE5KCI/Hmnx2SwBMCfALh+8t/k0OSMM276ADw3+fv9C1Ry7J7lhHHHlgJERAnDGTsRUcIwsBMRJQwDOxFRwjCwExElDAM7EVHCMLATESUMAzsRUcL8f9w4vILwr9wGAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(poly_log_reg, axis=[-4, 4, -4, 4])\n",
    "plt.scatter(X[y==0, 0], X[y==0, 1])\n",
    "plt.scatter(X[y==1, 0], X[y==1, 1])\n",
    "plt.show() # 从下图可以看到直接使用直线，预测效果比较差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.95"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg.score(X, y) # 预测正确率明显高了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "         steps=[('poly',\n",
       "                 PolynomialFeatures(degree=20, include_bias=True,\n",
       "                                    interaction_only=False, order='C')),\n",
       "                ('std_scaler',\n",
       "                 StandardScaler(copy=True, with_mean=True, with_std=True)),\n",
       "                ('log_reg', LogisticRegression())],\n",
       "         verbose=False)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "poly_log_reg = PolynomialLogisticRegression(degree=20)\n",
    "poly_log_reg.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "D:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:17: UserWarning: The following kwargs were not used by contour: 'linewidth'\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO2dfZBcZZ3vv7/p7jAdaJgEEjNMCKAYbkiQoFzu7g1eEQOGiFC7Rou9YTfXXSul8hKvWriYW3GXvdlFrWJBfLu5uJqtsKsYFhclvCSLqKTWFyQTyBCTiuwlZhwqQEjSIT0wPf27f/Scyenu85yXPk93nz7z/VRBpU+fl6dnpr/P7/m9PaKqIIQQkh56Oj0AQgghdqGwE0JIyqCwE0JIyqCwE0JIyqCwE0JIyqCwE0JIyrAm7CKSEZEdIvIjW/ckhBASHZsW+xoAuy3ejxBCSBNYEXYRmQvgAwDutXE/QgghzZO1dJ+7ANwKoGA6QURWA1gNANPyJ7/rLWefb+nRJC2cXnq100MgJNEMvvjiK6o6K+i82MIuItcAOKiqvxaRy03nqeoGABsAYN6Cd+ln/vHf4z6aJJw1CzfVvD5833iHRkJIOpixevWLYc6zYbEvAXCtiCwH0AvgVBHZpKo3WLg3SRirBjeGPvfwYAsHQggxElvYVfU2ALcBwITF/lmKevJZs3ATLWhCUootHztJAI7rI4xg05omJL1YFXZVfRLAkzbvSU4QZGVTrAkhAC32RBHkv6ZwE0LCQGHvAPRvE0JaCYW9xXhZ4bS8CSGthMJukSipgIQQ0ioo7DGhmBNCkgaFvQko5oSQJENhDwnFnBDSLVDYA6CgE0K6DQo7gN37R7B91z4US6Mo5HuxZNF5uOPQ450eFiGENMWU3xpv9/4RbHvmeRRLowCAYmkUTz79LLYU8x0eGSGENMeUF/btu/ahPF6pOTaqPbjnkLG1PCGEJJopL+yOpV7PS+VMm0dCCCF2mPLC3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dMOmwpQAhhKQMWuyEEJIyKOyEEJIyKOyEEJIyKOyEEJIyKOyEEJIyKOyEEJIyKOyEEJIy/j+pA4diTqKUbQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(poly_log_reg, axis=[-4, 4, -4, 4])\n",
    "plt.scatter(X[y==0, 0], X[y==0, 1])\n",
    "plt.scatter(X[y==1, 0], X[y==1, 1])\n",
    "plt.show() # 从下图可以看到直接使用直线，预测效果比较差"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
